package com.greenlife.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.greenlife.common.result.CommonResult;
import com.greenlife.controller.util.ControllerErrorProcessor;

@Controller
public class BaseController {
	private static final Logger log = LoggerFactory.getLogger(BaseController.class);

	@ExceptionHandler
	@ResponseBody
	public CommonResult	exceptionHandler(Exception ex){
		return ControllerErrorProcessor.exceptionProcessor(ex, log);
	}
}
